<%--
  Created by IntelliJ IDEA.
  User: 97203
  Date: 2018/06/08
  Time: 15:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<html>
<head>
    <title>Title</title>
    <%@include file="/static/common/common.jsp" %>
    <script type="text/javascript" src="/static/js/employee.js"></script>
</head>
<body>
<table id="emp_datagrid"></table>
<div id="tb">
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true" data-cmd="add">新增</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true" data-cmd="edit">编辑</a>
    <shiro:hasPermission name="employee:changeState">
        <a href="#" id="changeState_btn" class="easyui-linkbutton" data-options="iconCls:'icon-man',plain:true"
           data-cmd="changeState">离职</a>
    </shiro:hasPermission>
    <a href="#" id="changePwd_btn" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
       data-cmd="changePwd">重置密码</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" data-cmd="reload">刷新</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-redo',plain:true" data-cmd="exportXls">导出</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-undo',plain:true" data-cmd="importXls">导入</a>
    <div id="import_dialog">
        <form id="import_form" method="post" enctype="multipart/form-data" action="/employee/importXls.do">
            <table>
                <tr>
                    <td><input type="file" name="file" id="file"></td>
                    <td><input type="button" value="导入" onclick="fileSubmit()"></td>
                </tr>
            </table>
        </form>
    </div>
    <input name="keyword" class="easyui-textbox" prompt="请输入用户名或电话">
    <input name="deptId" class="easyui-combobox" prompt="请选择" fit="true"
           data-options="textField:'name',valueField:'id',panelHeight:'auto',
                                url:'/department/selectAll.do'">
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" data-cmd="query"></a>
</div>
<div id="emp_dialog">
    <form id="emp_form" method="post">
        <input id="empId" name="id" type="hidden">
        <table align="center" style="margin: 15px;">
            <tr>
                <td>用户名：</td>
                <td><input type="text" name="username" class="easyui-textbox" required="true" prompt="请输入姓名"
                           invalidMessage="用户名已存在"
                           validType="remote['/employee/validateUsername.do?id='+empId.value,'username']"
                ></td>
            </tr>
            <tr>
                <td>真实姓名：</td>
                <td><input type="text" name="realname" class="easyui-textbox"></td>
            </tr>
            <tr id="password_tr">
                <td>密码：</td>
                <td><input type="text" name="password" class="easyui-passwordbox"></td>
            </tr>
            <tr>
                <td>入职：</td>
                <td><input type="text" name="hireDate" class="easyui-datebox"></td>
            </tr>
            <tr>
                <td>电话：</td>
                <td><input type="text" name="tel" class="easyui-textbox"></td>
            </tr>
            <tr>
                <td>邮箱：</td>
                <td><input type="text" name="email" class="easyui-textbox" validType="email"></td>
            </tr>
            <tr>
                <td>部门：</td>
                <td><input type="text" name="dept.id" class="easyui-combobox"
                           data-options="textField:'name',valueField:'id',panelHeight:'auto',
                                url:'/department/selectAll.do'"></td>
            </tr>
            <tr>
                <td>管理员：</td>
                <td><input type="text" name="admin" class="easyui-combobox"
                           data-options='data:[{
                                "value":"1",
                                "text":"是"
                                },{
                                "value":"0",
                                "text":"否"
                                }],textField:"text",
                                valueField:"value",panelHeight:"auto"'>
                </td>
            </tr>
            <tr>
                <td>角色：</td>
                <td><input id="role_combobox" class="easyui-combobox"
                           data-options="textField:'name',valueField:'id',panelHeight:'auto',multiple:true,
                                url:'/role/selectAll.do'"></td>
            </tr>

            <div id="btn">
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
                   data-cmd="save">保存</a>
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true" data-cmd="cancel">取消</a>
            </div>
        </table>
    </form>
</div>
</body>
</html>
